namespace Cik.Gapi4Net.Domain.Input
{
    using System.Text;
    using Contract;
    using Enum;

    public class Web : EntityBase, IWeb
    {
        public string UniqueId { get; set; }

        public string Linked { get; set; }

        // Safe type
        public Safe Safe { get; set; }

        // ParticularLanguage type
        public ParticularLanguage ParticularLanguage { get; set; }

        // Filter type
        public Filter Filter { get; set; }

        // CountryCode type
        public CountryCode CountryCode { get; set; }

        public override string SearchWebUrl()
        {
            var builder = new StringBuilder();

            if (string.IsNullOrEmpty(Query) && string.IsNullOrEmpty(Version))
                return string.Empty;

            builder.AppendFormat("v={0}&q={1}", Version, Query);

            return builder.ToString();
        }
    }
}